const wx2my = require('../../../wx2my');
const Behavior = require('../../../Behavior');
var app = getApp();
Page({
  data: {
    index: 0
  },
  onLoad: function (t) {
    wx2my.setNavigationBarColor({
      frontColor: '#000000',
      backgroundColor: '#ffffff'
    }), this.setData({
      color: wx2my.getStorageSync("platform").color
    }), this.refresh();
  },
  refresh: function (t) {
    var e = this,
        n = e.data.index,
        a = wx2my.getStorageSync("userInfo").id;
    app.util.request({
      url: "entry/wxapp/MyTeam",
      data: {
        user_id: a
      },
      success: function (t) {
        if (console.log(t), 0 == n) {
          for (var a in t.data.one) t.data.one[a].time = app.ormatDate(t.data.one[a].time).slice(0, 10), t.data.one[a].ji = "一级下线";

          e.setData({
            list: t.data.one
          });
        }

        if (1 == n) {
          for (var o in t.data.two) t.data.two[o].time = app.ormatDate(t.data.two[o].time).slice(0, 16), t.data.two[o].ji = "二级下线";

          e.setData({
            list: t.data.two
          });
        }
      }
    });
  },
  whole2: function (t) {
    this.setData({
      index: 0
    }), this.refresh();
  },
  whole3: function (t) {
    this.setData({
      index: 1
    }), this.refresh();
  },
  onReady: function () {},
  onShow: function () {},
  onHide: function () {},
  onUnload: function () {},
  onPullDownRefresh: function () {},
  onReachBottom: function () {}
});